<?php
namespace Plu\Library\Services\Redis\Profile;

use Plu\Library\Services\ServiceBase;

class ProfileRedis extends ServiceBase {
    const key_of_usergreade = "u:grade";

    const key_of_usernewgrade = "u:newgrade";

    const key_of_user_valid = "u:valid";

    const key_of_user_mobiles = "u:mobiles";

	public function getGrade($uid) {
		$redis = $this->getRedis('profile');

		return $redis->hGet(self::key_of_usergreade, $uid);
    }

    public function getNewGrade($uid) {
		$redis = $this->getRedis('profile');

		return $redis->hGet(self::key_of_usernewgrade, $uid);
    }

    public function isValid($uid) {
		$redis = $this->getRedis('profile');

		return $redis->sIsMember(self::key_of_user_valid, $uid);
    }

    public function getMobile($uid) {
        $redis = $this->getRedis('login');

        return $redis->hGet(self::key_of_user_mobiles, $uid);
    }
}
?>
